<?php

use think\admin\model\SystemSites;
use think\migration\Migrator;

@set_time_limit(0);
@ini_set('memory_limit', -1);

/**
 * 系统模块初始化
 */
class AddokptSites extends Migrator
{
    /**
     * 数据库初始化
     * @return void
     */
    public function change()
    {
        $this->insertSites();
    }

    /**
     * 初始化站点数据
     * @return void
     */
    private function insertSites()
    {
        SystemSites::mQuery()->db()->insert([
            'site_name' => 'okpt',
            'site_url' => 'https://www.okpt.net',
            'api_url' => 'https://www.okpt.net/api/pieces-hash',
            'passkey' => '',
            'download_limit' => 0,
            'upload_limit' => 0,
            'status' => 1,
        ]
        );
    }
}
